package com.shopping.serviceImpl;

import com.shopping.dao.CategoryDao;
import com.shopping.pojo.Category;
import com.shopping.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryDao categoryDao;

    @Override
    public List<Category> selectCategoryByQuery(String cateName, int start, int limit) {
        return categoryDao.selectCategoryByQuery(cateName, start, limit);
    }

    @Override
    public int getCategoryNum(String cateName) {
        return categoryDao.getCategoryNum(cateName);
    }

    @Override
    public List<String> selectCategory() {
        return categoryDao.selectCategory();
    }

    @Override
    public int getCateId(String cateName) {
        return categoryDao.getCateId(cateName);
    }

    @Override
    public List<String> selectCateSkincare() {
        return categoryDao.selectCateSkincare();
    }

    @Override
    public List<String> selectCateMakeup() {
        return categoryDao.selectCateMakeup();
    }

    @Override
    public List<String> selectCateScentAndClean() {
        return categoryDao.selectCateScentAndClean();
    }

    @Override
    public boolean insertCate(Category category) {
        return categoryDao.insertCate(category)>0;
    }

    @Override
    public boolean updateCate(Category category) {
        return categoryDao.updateCate(category)>0;
    }

    @Override
    public boolean deleteCate(Integer categoryId) {
        return categoryDao.deleteCate(categoryId)>0;
    }

    @Override
    public List<String> selectClassify() {
        return categoryDao.selectClassify();
    }
}
